package io.github.junxworks.qt.modules.data.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import io.github.junxworks.ep.core.Result;
import io.github.junxworks.qt.modules.data.service.HistoryService;

@RestController
@RequestMapping("/stock/data")
public class StockHistoryDataController {
	@Autowired
	private HistoryService historyService;

	@GetMapping("/trade-dates")
	public Result getTradeDateByoffset(@RequestParam("offset") int offset) {
		return Result.ok(historyService.getTransDate(offset));
	}
}
